using System;
using System.Linq;

namespace Caramel.Entities
{
	public static class NamedEntityQueryableExtensions
	{
		public static IQueryable<INamedEntity> WhereNameIs<T>(this IQueryable<INamedEntity> queryable, string name)
		{
			return queryable.Where(e => e.Name == name);
		}

		public static IQueryable<INamedEntity> WhereIsActive<T>(this IQueryable<INamedEntity> queryable)
		{
			return queryable.Where(e => e.IsActive);
		}
	}
}
